home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / dev / misc / new_PCQ_lib.lha / Update_PCQ.lib / ReadMe.p < prev   
Text File  |  1995-04-27  |  2KB  |  57 lines

  1. Program The_hearing_and_the_sense_of_balance;
  2.  
  3. { ***********************************************************************
  4.   *                                     *
  5.   * This little piece of code is less to test the dos.library function    *
  6.   * NameFromFH() with using PCQ-Pascal, but more for this information    *
  7.   * text.                                *
  8.   *                                     *
  9.   * We found a bug in the pcq.lib ( NameFromFH always went meditating    *
  10.   * in India, caused by a wrong implemented offset ) and in the include    *
  11.   * file dos/dos.i ( Not enough the function guru'd, the parameter      *
  12.   * 'buffer' was passed by wrong. ) , so in this packet you'll find the *
  13.   * debugged versions :                            *
  14.   *                                     *
  15.   *   dos.i      15528 Bytes    to be placed in Include:dos/        *
  16.   *   pcq.lib   104684 Bytes    to be placed so that BLink finds it    *
  17.   *                                     *
  18.   * Notice that NameFromFH() no longer handles the parameter 'Buffer'    *
  19.   * as global variable, but as local.                    *
  20.   *                                     *
  21.   * If anyone finds another bug, please email us.            *
  22.   *                                     *
  23.   *     Andreas Tetzl            Bernd Künnen            *
  24.   *    A.Tetzl@Saxonia.De        Diesel@Uni-Muenster.De        *
  25.   *                                     *
  26.   ******* GreetinX to all fans of  'Fury in the Slaughterhouse' ! *******
  27.  
  28.  
  29. {$I "Include:dos/dos.i" }  { * Use the new one ! * }
  30.  
  31. VAR
  32.     my_string    : String;
  33.     my_buffer    : Array[1..132] of Char;
  34.     my_filehandle    : FileHandle;
  35.  
  36. Begin
  37.     { * Assign the buffer * }
  38.     my_string := adr( my_buffer );
  39.  
  40.     { * Open e.g. the startup-sequence, to have an filehandle * }
  41.     my_filehandle := DosOpen("s:startup-sequence", mode_oldfile );
  42.     if my_filehandle = NIL then Exit;  { * hello & goodbye * }
  43.  
  44.     { * Test NameFromFH() * }
  45.     WriteLn("Result(Boolean): ",
  46.         NameFromFH( my_filehandle, my_string, 132 )
  47.            );
  48.  
  49.     { * And the winner is ... * }
  50.     WriteLn("Name of file is: ", my_string );
  51.  
  52.     { * Hang the DJ kiss goodbye * }
  53.     DosClose( my_filehandle );
  54.  
  55. end.
  56.  
  57.